package service.Impl;

import dao.CommentDao;
import dao.Impl.CommentDaoImpl;
import entity.Comment;
import service.CommentService;

import java.util.List;

public class CommentServiceImpl implements CommentService {
    private CommentDao commentDao = new CommentDaoImpl();
    @Override
    public List<Comment> findAll() {
        return commentDao.findAll();
    }

    @Override
    public boolean update(Comment comment) {
       return commentDao.update(comment);

    }
    @Override
    public boolean delete(int id) {return commentDao.delete(id);}
    @Override
    public List<Comment> findByUserName(String userName) {
        return commentDao.findByUserName(userName);
    }

    @Override
    public void addComment(Comment comment) {
         commentDao.addComment(comment);
    }

}
